package April._17.work3;

import java.io.FileOutputStream;
import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException {
        String[] words = new String[]{"verb:eat","verb:drink","verb:sleep","verb:play","noun:rice","noun:meat","noun:hand","noun:hair"};
        FileOutputStream fileOutputStream = new FileOutputStream("fileTest\\verb.txt");
        FileOutputStream outNoun = new FileOutputStream("fileTest\\noun.txt");

        for (String word : words) {
            if(word.startsWith("verb")){
                fileOutputStream.write(word.getBytes());
                fileOutputStream.write("\r\n".getBytes());
            }
            if(word.startsWith("noun")){
                outNoun.write(word.getBytes());
                outNoun.write("\r\n".getBytes());
            }
        }
    }
}
